<template>
    <el-table
        style="width: 100%"
        :key="props.tableKey"
        v-loading="props.loading"
        :class="{'custom-table-wrap-no-data': props.tableData.length <= 0}"
        :data="props.tableData">
        <slot></slot>
        <template #empty>
            <NoData :show="true"></NoData>
        </template>
    </el-table>
</template>

<script>
import NoData from '@/components/no-data.vue';
export default {
    name: 'table-content',
    components: {
        NoData
    },
    props: {
        tableData: {
            type: Array,
            default: () => []
        },
        loading: {
            type: Boolean,
            default: false
        },
        tableKey: { // 设置不同的tablekey 解决tabs下的表格刷新抖动问题，表格不在tabs下不用设置
            type: String,
            default: 'r'
        }
    },
    setup (props) {
        return {
            props
        }
    }
}
</script>